<?php
include_once("includes/common_public_inc.php");
/*****************/
$includeHeader = getParam("header","");
/****************/
$arrayOfInfoMercados = getArrayOfCatImages();
$tplList = new TplLoad;

$mercadosIdArray = array(
	1  => 'trans',
	13 => 'agro',
	16 => 'vial',
	17 => 'grua',
	1002 => 'serv'
);

$mercados = array();
foreach ($mercadosIdArray as $mercadoId => $inputId){

	$mercados[$mercadoId] = array(
		'idInput' 	   => $inputId,
		'cat_image'    => $arrayOfInfoMercados[$mercadoId]['cat_image'],
		'cat_fatherid' => $arrayOfInfoMercados[$mercadoId]['cat_fatherid'],
		'cat_name' 	   => str_replace("Venta", "", $arrayOfInfoMercados[$mercadoId]['cat_name'])
	);	
}
//¿Está el usuario Logueado?
if(!empty($_SESSION["valid_user"])){
	//obtenemos la direccion de email
	$user = getUserinfoByKey($_SESSION["valid_user"]);
	$tplList->assign("email",$user['user_email']);
}

$tplList->assign("mercados",$mercados);
$tplList->assign("includeHeader",$includeHeader);
$tplList->display("newsletter_dialog.tpl");
?>
